<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style type="text/css">
		#box{
			width: 400px;
			height: 200px;
			border: 1px solid skyblue;
		}
	</style>
	<script type="text/javascript">
		//定义页面载入事件
		window.onload=function(){
			//获取dom并绑定onclick事件
			document.getElementById('box').onclick=function(){
				var box=document.getElementById('box');
				box.style.backgroundColor='darkgray';
			}
			
			
			
		}
	</script>
	<body>
		<div id="box">
          abcdefghijklmnopqrstuvwxyz			
		</div>
	</body>
</html>
